.class public Lcom/instagram/android/o/f;
.super Ljava/lang/Object;
.source "QuickExperimentManager.java"


# static fields
.field private static final a:Ljava/util/concurrent/ExecutorService;

.field private static final b:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Lcom/instagram/android/o/f;",
            ">;"
        }
    .end annotation
.end field

.field private static c:Lcom/instagram/android/o/i;


# instance fields
.field private final d:Ljava/lang/String;

.field private final e:Lcom/instagram/android/o/c;

.field private final f:Ljava/util/Set;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Set",
            "<",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method static constructor <clinit>()V
    .locals 1

    .prologue
    .line 36
    invoke-static {}, Ljava/util/concurrent/Executors;->newSingleThreadExecutor()Ljava/util/concurrent/ExecutorService;

    move-result-object v0

    sput-object v0, Lcom/instagram/android/o/f;->a:Ljava/util/concurrent/ExecutorService;

    .line 37
    new-instance v0, Ljava/util/HashMap;

    invoke-direct {v0}, Ljava/util/HashMap;-><init>()V

    sput-object v0, Lcom/instagram/android/o/f;->b:Ljava/util/Map;

    return-void
.end method

.method private constructor <init>(Ljava/lang/String;)V
    .locals 5
    .parameter

    .prologue
    .line 68
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 66
    new-instance v0, Ljava/util/HashSet;

    invoke-direct {v0}, Ljava/util/HashSet;-><init>()V

    iput-object v0, p0, Lcom/instagram/android/o/f;->f:Ljava/util/Set;

    .line 69
    iput-object p1, p0, Lcom/instagram/android/o/f;->d:Ljava/lang/String;

    .line 70
    invoke-static {}, Lcom/instagram/android/o/j;->values()[Lcom/instagram/android/o/j;

    move-result-object v1

    array-length v2, v1

    const/4 v0, 0x0

    :goto_0
    if-ge v0, v2, :cond_0

    aget-object v3, v1, v0

    .line 71
    iget-object v4, p0, Lcom/instagram/android/o/f;->f:Ljava/util/Set;

    invoke-virtual {v3}, Lcom/instagram/android/o/j;->a()Ljava/lang/String;

    move-result-object v3

    invoke-interface {v4, v3}, Ljava/util/Set;->add(Ljava/lang/Object;)Z

    .line 70
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 73
    :cond_0
    if-nez p1, :cond_1

    .line 74
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/instagram/android/o/f;->e:Lcom/instagram/android/o/c;

    .line 79
    :goto_1
    return-void

    .line 76
    :cond_1
    new-instance v0, Lcom/instagram/android/o/d;

    invoke-direct {v0, p1}, Lcom/instagram/android/o/d;-><init>(Ljava/lang/String;)V

    iput-object v0, p0, Lcom/instagram/android/o/f;->e:Lcom/instagram/android/o/c;

    .line 77
    iget-object v0, p0, Lcom/instagram/android/o/f;->e:Lcom/instagram/android/o/c;

    invoke-interface {v0}, Lcom/instagram/android/o/c;->a()V

    goto :goto_1
.end method

.method static synthetic a(Lcom/instagram/android/o/f;)Lcom/instagram/android/o/c;
    .locals 1
    .parameter

    .prologue
    .line 35
    iget-object v0, p0, Lcom/instagram/android/o/f;->e:Lcom/instagram/android/o/c;

    return-object v0
.end method

.method public static a()Lcom/instagram/android/o/f;
    .locals 2

    .prologue
    .line 52
    invoke-static {}, Lcom/instagram/android/util/b;->a()Ljava/lang/String;

    move-result-object v0

    .line 53
    invoke-static {v0}, Lcom/instagram/n/i;->a(Ljava/lang/CharSequence;)Z

    move-result v1

    if-nez v1, :cond_0

    .line 54
    invoke-static {v0}, Lcom/instagram/android/o/f;->a(Ljava/lang/String;)Lcom/instagram/android/o/f;

    move-result-object v0

    .line 56
    :goto_0
    return-object v0

    :cond_0
    new-instance v0, Lcom/instagram/android/o/f;

    const/4 v1, 0x0

    invoke-direct {v0, v1}, Lcom/instagram/android/o/f;-><init>(Ljava/lang/String;)V

    goto :goto_0
.end method

.method public static declared-synchronized a(Ljava/lang/String;)Lcom/instagram/android/o/f;
    .locals 3
    .parameter

    .prologue
    .line 43
    const-class v1, Lcom/instagram/android/o/f;

    monitor-enter v1

    :try_start_0
    sget-object v0, Lcom/instagram/android/o/f;->b:Ljava/util/Map;

    invoke-interface {v0, p0}, Ljava/util/Map;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/android/o/f;

    .line 44
    if-nez v0, :cond_0

    .line 45
    new-instance v0, Lcom/instagram/android/o/f;

    invoke-direct {v0, p0}, Lcom/instagram/android/o/f;-><init>(Ljava/lang/String;)V

    .line 46
    sget-object v2, Lcom/instagram/android/o/f;->b:Ljava/util/Map;

    invoke-interface {v2, p0, v0}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
    :try_end_0
    .catchall {:try_start_0 .. :try_end_0} :catchall_0

    .line 48
    :cond_0
    monitor-exit v1

    return-object v0

    .line 43
    :catchall_0
    move-exception v0

    monitor-exit v1

    throw v0
.end method

.method public static a(Landroid/content/Context;)V
    .locals 1
    .parameter

    .prologue
    .line 61
    new-instance v0, Lcom/instagram/android/o/i;

    invoke-direct {v0, p0}, Lcom/instagram/android/o/i;-><init>(Landroid/content/Context;)V

    sput-object v0, Lcom/instagram/android/o/f;->c:Lcom/instagram/android/o/i;

    .line 62
    return-void
.end method

.method private a(Ljava/lang/String;Ljava/util/Map;)V
    .locals 6
    .parameter
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;)V"
        }
    .end annotation

    .prologue
    const/4 v1, 0x0

    .line 156
    .line 157
    if-eqz p2, :cond_0

    invoke-interface {p2}, Ljava/util/Map;->size()I

    move-result v0

    if-lez v0, :cond_0

    .line 158
    new-instance v0, Lcom/fasterxml/jackson/databind/ObjectMapper;

    invoke-direct {v0}, Lcom/fasterxml/jackson/databind/ObjectMapper;-><init>()V

    .line 160
    :try_start_0
    invoke-virtual {v0, p2}, Lcom/fasterxml/jackson/databind/ObjectMapper;->writeValueAsString(Ljava/lang/Object;)Ljava/lang/String;
    :try_end_0
    .catch Lcom/fasterxml/jackson/a/p; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v0

    .line 166
    :goto_0
    invoke-static {}, Lcom/instagram/b/a;->a()Lcom/instagram/b/c;

    move-result-object v2

    new-instance v3, Lcom/instagram/b/b;

    const-string v4, "qe_exposure"

    invoke-direct {v3, v4, v1}, Lcom/instagram/b/b;-><init>(Ljava/lang/String;Lcom/instagram/b/d;)V

    const-string v1, "device_id"

    iget-object v4, p0, Lcom/instagram/android/o/f;->d:Ljava/lang/String;

    invoke-virtual {v3, v1, v4}, Lcom/instagram/b/b;->a(Ljava/lang/String;Ljava/lang/String;)Lcom/instagram/b/b;

    move-result-object v1

    const-string v3, "experiments"

    const-string v4, ","

    iget-object v5, p0, Lcom/instagram/android/o/f;->f:Ljava/util/Set;

    invoke-static {v4, v5}, Landroid/text/TextUtils;->join(Ljava/lang/CharSequence;Ljava/lang/Iterable;)Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v1, v3, v4}, Lcom/instagram/b/b;->a(Ljava/lang/String;Ljava/lang/String;)Lcom/instagram/b/b;

    move-result-object v1

    invoke-interface {v2, v1}, Lcom/instagram/b/c;->a(Lcom/instagram/b/b;)V

    .line 171
    new-instance v1, Lcom/instagram/android/o/a/a;

    iget-object v2, p0, Lcom/instagram/android/o/f;->d:Ljava/lang/String;

    invoke-direct {v1, v2, p1, v0}, Lcom/instagram/android/o/a/a;-><init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V

    .line 174
    sget-object v0, Lcom/instagram/android/o/f;->a:Ljava/util/concurrent/ExecutorService;

    new-instance v2, Lcom/instagram/android/o/h;

    invoke-direct {v2, p0, v1}, Lcom/instagram/android/o/h;-><init>(Lcom/instagram/android/o/f;Lcom/instagram/android/o/a/a;)V

    invoke-interface {v0, v2}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V

    .line 190
    return-void

    .line 161
    :catch_0
    move-exception v0

    .line 162
    const-class v2, Lcom/instagram/android/o/f;

    const-string v3, "Error converting to JSON!"

    invoke-static {v2, v3, v0}, Lcom/facebook/e/a/a;->b(Ljava/lang/Class;Ljava/lang/String;Ljava/lang/Throwable;)V

    :cond_0
    move-object v0, v1

    goto :goto_0
.end method

.method static synthetic b(Lcom/instagram/android/o/f;)Ljava/util/Set;
    .locals 1
    .parameter

    .prologue
    .line 35
    iget-object v0, p0, Lcom/instagram/android/o/f;->f:Ljava/util/Set;

    return-object v0
.end method

.method static synthetic c(Lcom/instagram/android/o/f;)Ljava/lang/String;
    .locals 1
    .parameter

    .prologue
    .line 35
    iget-object v0, p0, Lcom/instagram/android/o/f;->d:Ljava/lang/String;

    return-object v0
.end method


# virtual methods
.method public a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
    .locals 1
    .parameter
    .parameter
    .parameter

    .prologue
    .line 112
    const/4 v0, 0x0

    invoke-virtual {p0, p1, p2, p3, v0}, Lcom/instagram/android/o/f;->a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public a(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)Ljava/lang/String;
    .locals 1
    .parameter
    .parameter
    .parameter
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;)",
            "Ljava/lang/String;"
        }
    .end annotation

    .prologue
    .line 94
    iget-object v0, p0, Lcom/instagram/android/o/f;->d:Ljava/lang/String;

    if-nez v0, :cond_1

    .line 105
    :cond_0
    :goto_0
    return-object p3

    .line 97
    :cond_1
    iget-object v0, p0, Lcom/instagram/android/o/f;->e:Lcom/instagram/android/o/c;

    invoke-interface {v0, p1}, Lcom/instagram/android/o/c;->a(Ljava/lang/String;)Lcom/instagram/android/o/b;

    move-result-object v0

    .line 98
    if-eqz v0, :cond_0

    .line 99
    invoke-virtual {v0, p2}, Lcom/instagram/android/o/b;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 100
    if-eqz v0, :cond_0

    .line 101
    invoke-direct {p0, p1, p4}, Lcom/instagram/android/o/f;->a(Ljava/lang/String;Ljava/util/Map;)V

    move-object p3, v0

    .line 102
    goto :goto_0
.end method

.method public b()V
    .locals 3

    .prologue
    .line 120
    iget-object v0, p0, Lcom/instagram/android/o/f;->d:Ljava/lang/String;

    if-eqz v0, :cond_0

    sget-object v0, Lcom/instagram/android/o/f;->c:Lcom/instagram/android/o/i;

    invoke-virtual {v0}, Lcom/instagram/android/o/i;->a()Z

    move-result v0

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/instagram/android/o/f;->f:Ljava/util/Set;

    invoke-interface {v0}, Ljava/util/Set;->isEmpty()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 148
    :cond_0
    :goto_0
    return-void

    .line 123
    :cond_1
    new-instance v0, Lcom/instagram/android/o/a/c;

    iget-object v1, p0, Lcom/instagram/android/o/f;->d:Ljava/lang/String;

    iget-object v2, p0, Lcom/instagram/android/o/f;->f:Ljava/util/Set;

    invoke-direct {v0, v1, v2}, Lcom/instagram/android/o/a/c;-><init>(Ljava/lang/String;Ljava/util/Set;)V

    .line 126
    sget-object v1, Lcom/instagram/android/o/f;->a:Ljava/util/concurrent/ExecutorService;

    new-instance v2, Lcom/instagram/android/o/g;

    invoke-direct {v2, p0, v0}, Lcom/instagram/android/o/g;-><init>(Lcom/instagram/android/o/f;Lcom/instagram/android/o/a/c;)V

    invoke-interface {v1, v2}, Ljava/util/concurrent/ExecutorService;->execute(Ljava/lang/Runnable;)V

    goto :goto_0
.end method
